#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<stdlib.h>

int* findPeaks(int* mountain, int mountainSize, int* returnSize) 
{
    int k = 0;
    int* sum = (int*)malloc(100 * sizeof(int));
    for (int i = 1; i < mountainSize - 1; i++)
    {
        if (mountain[i] > mountain[i - 1] && mountain[i] > mountain[i + 1])
        {
            sum[k++] = i;
            i++;
        }
    }
    *returnSize = k;
    return sum;
}